#ifndef __NVTX_TO_MCTX_ADAPTOR_H__
#define __NVTX_TO_MCTX_ADAPTOR_H__

/* ====================== mcToolsExt.h ============================== */
#define NVTX_VERSIONED_IDENTIFIER_L3 MCTX_VERSIONED_IDENTIFIER_L3
#define NVTX_VERSIONED_IDENTIFIER_L2 MCTX_VERSIONED_IDENTIFIER_L2
#define NVTX_VERSIONED_IDENTIFIER    MCTX_VERSIONED_IDENTIFIER

#define NVTX_SUCCESS                              MCTX_SUCCESS
#define NVTX_FAIL                                 MCTX_FAIL
#define NVTX_ERR_INIT_LOAD_PROPERTY               MCTX_ERR_INIT_LOAD_PROPERTY
#define NVTX_ERR_INIT_ACCESS_LIBRARY              MCTX_ERR_INIT_ACCESS_LIBRARY
#define NVTX_ERR_INIT_LOAD_LIBRARY                MCTX_ERR_INIT_LOAD_LIBRARY
#define NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT MCTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT
#define NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT  MCTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT
#define NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE   MCTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE

#define NVTX_EVENT_ATTRIB_STRUCT_SIZE MCTX_EVENT_ATTRIB_STRUCT_SIZE
#define NVTX_NO_PUSH_POP_TRACKING     MCTX_NO_PUSH_POP_TRACKING

#define nvtxRangeId_t mctxRangeId_t

#define nvtxDomainRegistration_st mctxDomainRegistration_st
#define nvtxDomainRegistration    mctxDomainRegistration
#define nvtxDomainHandle_t        mctxDomainHandle_t

#define nvtxStringRegistration_st mctxStringRegistration_st
#define nvtxStringRegistration    mctxStringRegistration
#define nvtxStringHandle_t        mctxStringHandle_t

/* Color Types */
#define nvtxColorType_t    mctxColorType_t
#define NVTX_COLOR_UNKNOWN MCTX_COLOR_UNKNOWN
#define NVTX_COLOR_ARGB    MCTX_COLOR_ARGB

/* Message Types */
#define nvtxMessageType_t            mctxMessageType_t
#define NVTX_MESSAGE_UNKNOWN         MCTX_MESSAGE_UNKNOWN
#define NVTX_MESSAGE_TYPE_ASCII      MCTX_MESSAGE_TYPE_ASCII
#define NVTX_MESSAGE_TYPE_UNICODE    MCTX_MESSAGE_TYPE_UNICODE
#define NVTX_MESSAGE_TYPE_REGISTERED MCTX_MESSAGE_TYPE_REGISTERED

#define nvtxMessageValue_t mctxMessageValue_t

/* ------------------------------------------------------------------------- */
/* Force initialization (optional) */
//#define nvtxInitialize wnvtxInitialize_v3

/* Payload Types */
#define nvtxPayloadType_t                mctxPayloadType_t
#define NVTX_PAYLOAD_UNKNOWN             MCTX_PAYLOAD_UNKNOWN
#define NVTX_PAYLOAD_TYPE_UNSIGNED_INT64 MCTX_PAYLOAD_TYPE_UNSIGNED_INT64
#define NVTX_PAYLOAD_TYPE_INT64          MCTX_PAYLOAD_TYPE_INT64
#define NVTX_PAYLOAD_TYPE_DOUBLE         MCTX_PAYLOAD_TYPE_DOUBLE
#define NVTX_PAYLOAD_TYPE_UNSIGNED_INT32 MCTX_PAYLOAD_TYPE_UNSIGNED_INT32
#define NVTX_PAYLOAD_TYPE_INT32          MCTX_PAYLOAD_TYPE_INT32
#define NVTX_PAYLOAD_TYPE_FLOAT          MCTX_PAYLOAD_TYPE_FLOAT

#define nvtxEventAttributes_v2 mctxEventAttributes_v2
#define nvtxEventAttributes_t  mctxEventAttributes_t

#define nvtxDomainMarkEx wnvtxDomainMarkEx

#define nvtxMarkEx             wnvtxMarkEx
#define nvtxMarkA              wnvtxMarkA
#define nvtxMarkW              wnvtxMarkW
#define nvtxDomainRangeStartEx wnvtxDomainRangeStartEx
#define nvtxRangeStartEx       wnvtxRangeStartEx
#define nvtxRangeStartA        wnvtxRangeStartA
#define nvtxRangeStartW        wnvtxRangeStartW
#define nvtxDomainRangeEnd     wnvtxDomainRangeEnd

#define nvtxRangeEnd wnvtxRangeEnd

#define nvtxDomainRangePushEx wnvtxDomainRangePushEx

#define nvtxRangePushEx    wnvtxRangePushEx
#define nvtxRangePushA     wnvtxRangePushA
#define nvtxRangePushW     wnvtxRangePushW
#define nvtxDomainRangePop wnvtxDomainRangePop
#define nvtxRangePop       wnvtxRangePop

/*  ------------------------------------------------------------------------- */
/* Functions for Generic Resource Naming */
#define NVTX_RESOURCE_MAKE_TYPE     MCTX_RESOURCE_MAKE_TYPE
#define NVTX_RESOURCE_CLASS_GENERIC MCTX_RESOURCE_CLASS_GENERIC

#define nvtxResourceGenericType_t                mctxResourceGenericType_t
#define NVTX_RESOURCE_TYPE_UNKNOWN               MCTX_RESOURCE_TYPE_UNKNOWN
#define NVTX_RESOURCE_TYPE_GENERIC_POINTER       MCTX_RESOURCE_TYPE_GENERIC_POINTER
#define NVTX_RESOURCE_TYPE_GENERIC_HANDLE        MCTX_RESOURCE_TYPE_GENERIC_HANDLE
#define NVTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE MCTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE
#define NVTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX  MCTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX

#define nvtxResourceAttributes_v0 mctxResourceAttributes_v0
#define nvtxResourceAttributes_t  mctxResourceAttributes_t

#define NVTX_RESOURCE_ATTRIB_STRUCT_SIZE MCTX_RESOURCE_ATTRIB_STRUCT_SIZE
#define nvtxResourceHandle               mctxResourceHandle
#define nvtxResourceHandle_t             mctxResourceHandle_t

#define nvtxDomainResourceCreate  wnvtxDomainResourceCreate
#define nvtxDomainResourceDestroy wnvtxDomainResourceDestroy
#define nvtxDomainNameCategoryA   wnvtxDomainNameCategoryA
#define nvtxDomainNameCategoryW   wnvtxDomainNameCategoryW
#define nvtxNameCategoryA         wnvtxNameCategoryA
#define nvtxNameCategoryW         wnvtxNameCategoryW
#define nvtxNameOsThreadA         wnvtxNameOsThreadA
#define nvtxNameOsThreadW         wnvtxNameOsThreadW

#define nvtxDomainRegisterStringA wnvtxDomainRegisterStringA
#define nvtxDomainRegisterStringW wnvtxDomainRegisterStringW
#define nvtxDomainCreateA         wnvtxDomainCreateA
#define nvtxDomainCreateW         wnvtxDomainCreateW
#define nvtxDomainDestroy         wnvtxDomainDestroy

#define NVTX_IMPL_GUARD MCTX_IMPL_GUARD

/* new for NVTX_V2 */
/* this is new symbols for nvtx(nvToolsExt.h) diff from nvtx3(nvtx3/nvToolsExt.h) */
#define NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE MCTX_INITIALIZATION_ATTRIB_STRUCT_SIZE

#define nvtxStringHandle                       mctxStringRegistration_st
#define nvtxDomainHandle                       mctxDomainRegistration_st

#define nvtxInitializationMode_t               mctxInitializationMode_t
#define NVTX_INITIALIZATION_MODE_UNKNOWN       MCTX_INITIALIZATION_MODE_UNKNOWN
#define NVTX_INITIALIZATION_MODE_CALLBACK_V1   MCTX_INITIALIZATION_MODE_CALLBACK_V1
#define NVTX_INITIALIZATION_MODE_CALLBACK_V2   MCTX_INITIALIZATION_MODE_CALLBACK_V2
#define NVTX_INITIALIZATION_MODE_SIZE          MCTX_INITIALIZATION_MODE_SIZE

#define nvtxInitializationAttributes_v2        mctxInitializationAttributes_v2
#define nvtxInitializationAttributes_t         mctxInitializationAttributes_t

//#define nvtxInitialize wnvtxInitialize_v2
/*  new for NVTX_V2 end  */
/* ====================== mcToolsExt.h end ============================== */

/* ====================== mcToolsExtCuda.h ================================ */
#define NVTX_RESOURCE_CLASS_CUDA MCTX_RESOURCE_CLASS_MACA

#define nvtxResourceCUDAType_t          mctxResourceMACAType_t
#define NVTX_RESOURCE_TYPE_CUDA_DEVICE  MCTX_RESOURCE_TYPE_MACA_DEVICE
#define NVTX_RESOURCE_TYPE_CUDA_CONTEXT MCTX_RESOURCE_TYPE_MACA_CONTEXT
#define NVTX_RESOURCE_TYPE_CUDA_STREAM  MCTX_RESOURCE_TYPE_MACA_STREAM
#define NVTX_RESOURCE_TYPE_CUDA_EVENT   MCTX_RESOURCE_TYPE_MACA_EVENT
/* ------------------------------------------------------------------------- */
#define nvtxNameCuDeviceA wnvtxNameCuDeviceA
#define nvtxNameCuDeviceW wnvtxNameCuDeviceW

#define nvtxNameCuContextA wnvtxNameCuContextA
#define nvtxNameCuContextW wnvtxNameCuContextW

#define nvtxNameCuStreamA wnvtxNameCuStreamA
#define nvtxNameCuStreamW wnvtxNameCuStreamW

#define nvtxNameCuEventA wnvtxNameCuEventA
#define nvtxNameCuEventW wnvtxNameCuEventW

/* ====================== mcToolsExtCuda.h end ============================ */

/* ====================== mcToolsExtCudaRt.h ============================== */
#define NVTX_RESOURCE_CLASS_CUDART MCTX_RESOURCE_CLASS_MACART

#define nvtxResourceCUDARTType_t         mctxResourceMACAType_t
#define NVTX_RESOURCE_TYPE_CUDART_DEVICE MCTX_RESOURCE_TYPE_MACA_DEVICE
#define NVTX_RESOURCE_TYPE_CUDART_STREAM MCTX_RESOURCE_TYPE_MACA_STREAM
#define NVTX_RESOURCE_TYPE_CUDART_EVENT  MCTX_RESOURCE_TYPE_MACA_EVENT
/* function APIs */
#define nvtxNameCudaDeviceA wnvtxNameCudaDeviceA
#define nvtxNameCudaDeviceW wnvtxNameCudaDeviceW

#define nvtxNameCudaStreamA wnvtxNameCudaStreamA
#define nvtxNameCudaStreamW wnvtxNameCudaStreamW

#define nvtxNameCudaEventA wnvtxNameCudaEventA
#define nvtxNameCudaEventW wnvtxNameCudaEventW

/* ====================== mcToolsExtCudaRt.h end ============================== */

/* ====================== mcToolsExtOpenCL.h ============================== */
#define NVTX_RESOURCE_CLASS_OPENCL MCTX_RESOURCE_CLASS_OPENCL

#define nvtxResourceOpenCLType_t               mctxResourceOpenCLType_t
#define NVTX_RESOURCE_TYPE_OPENCL_DEVICE       MCTX_RESOURCE_TYPE_OPENCL_DEVICE
#define NVTX_RESOURCE_TYPE_OPENCL_CONTEXT      MCTX_RESOURCE_TYPE_OPENCL_CONTEXT
#define NVTX_RESOURCE_TYPE_OPENCL_COMMANDQUEUE MCTX_RESOURCE_TYPE_OPENCL_COMMANDQUEUE
#define NVTX_RESOURCE_TYPE_OPENCL_MEMOBJECT    MCTX_RESOURCE_TYPE_OPENCL_MEMOBJECT
#define NVTX_RESOURCE_TYPE_OPENCL_SAMPLER      MCTX_RESOURCE_TYPE_OPENCL_SAMPLER
#define NVTX_RESOURCE_TYPE_OPENCL_PROGRAM      MCTX_RESOURCE_TYPE_OPENCL_PROGRAM
#define NVTX_RESOURCE_TYPE_OPENCL_EVENT        MCTX_RESOURCE_TYPE_OPENCL_EVENT

/* Annotates an OpenCL device. */
#define nvtxNameClDeviceA wnvtxNameClDeviceA
#define nvtxNameClDeviceW wnvtxNameClDeviceW

#define nvtxNameClContextA wnvtxNameClContextA
#define nvtxNameClContextW wnvtxNameClContextW

#define nvtxNameClCommandQueueA wnvtxNameClCommandQueueA
#define nvtxNameClCommandQueueW wnvtxNameClCommandQueueW

#define nvtxNameClMemObjectA wnvtxNameClMemObjectA
#define nvtxNameClMemObjectW wnvtxNameClMemObjectW

#define nvtxNameClSamplerA wnvtxNameClSamplerA
#define nvtxNameClSamplerW wnvtxNameClSamplerW

#define nvtxNameClProgramA wnvtxNameClProgramA
#define nvtxNameClProgramW wnvtxNameClProgramW

#define nvtxNameClEventA wnvtxNameClEventA
#define nvtxNameClEventW wnvtxNameClEventW

/* ====================== mcToolsExtOpenCL.h end ============================== */

/* ====================== mcToolsExtSync.h ============================== */
#define NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE MCTX_SYNCUSER_ATTRIB_STRUCT_SIZE

#define NVTX_RESOURCE_CLASS_SYNC_OS      MCTX_RESOURCE_CLASS_SYNC_OS
#define NVTX_RESOURCE_CLASS_SYNC_PTHREAD MCTX_RESOURCE_CLASS_SYNC_PTHREAD

#define nvtxResourceSyncPosixThreadType_t         mctxResourceSyncPosixThreadType_t
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_MUTEX     MCTX_RESOURCE_TYPE_SYNC_PTHREAD_MUTEX
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_CONDITION MCTX_RESOURCE_TYPE_SYNC_PTHREAD_CONDITION
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_RWLOCK    MCTX_RESOURCE_TYPE_SYNC_PTHREAD_RWLOCK
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_BARRIER   MCTX_RESOURCE_TYPE_SYNC_PTHREAD_BARRIER
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_SPINLOCK  MCTX_RESOURCE_TYPE_SYNC_PTHREAD_SPINLOCK
#define NVTX_RESOURCE_TYPE_SYNC_PTHREAD_ONCE      MCTX_RESOURCE_TYPE_SYNC_PTHREAD_ONCE

#define nvtxResourceSyncWindowsType_t             mctxResourceSyncWindowsType_t
#define NVTX_RESOURCE_TYPE_SYNC_WINDOWS_MUTEX     MCTX_RESOURCE_TYPE_SYNC_WINDOWS_MUTEX
#define NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SEMAPHORE MCTX_RESOURCE_TYPE_SYNC_WINDOWS_SEMAPHORE
#define NVTX_RESOURCE_TYPE_SYNC_WINDOWS_EVENT     MCTX_RESOURCE_TYPE_SYNC_WINDOWS_EVENT
#define NVTX_RESOURCE_TYPE_SYNC_WINDOWS_CRITICAL_SECTION                                           \
    MCTX_RESOURCE_TYPE_SYNC_WINDOWS_CRITICAL_SECTION
#define NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SRWLOCK MCTX_RESOURCE_TYPE_SYNC_WINDOWS_SRWLOCK

#define nvtxResourceSyncLinuxType_t              mctxResourceSyncLinuxType_t
#define nvtxResourceSyncAndroidType_t            mctxResourceSyncAndroidType_t
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_MUTEX      MCTX_RESOURCE_TYPE_SYNC_LINUX_MUTEX
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_FUTEX      MCTX_RESOURCE_TYPE_SYNC_LINUX_FUTEX
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_SEMAPHORE  MCTX_RESOURCE_TYPE_SYNC_LINUX_SEMAPHORE
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_COMPLETION MCTX_RESOURCE_TYPE_SYNC_LINUX_COMPLETION
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_SPINLOCK   MCTX_RESOURCE_TYPE_SYNC_LINUX_SPINLOCK
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_SEQLOCK    MCTX_RESOURCE_TYPE_SYNC_LINUX_SEQLOCK
#define NVTX_RESOURCE_TYPE_SYNC_LINUX_RCU        MCTX_RESOURCE_TYPE_SYNC_LINUX_RCU

#define nvtxSyncUser   mctxSyncUser
#define nvtxSyncUser_t mctxSyncUser_t

#define nvtxSyncUserAttributes_v0 mctxSyncUserAttributes_v0
#define nvtxSyncUserAttributes_t  mctxSyncUserAttributes_t

/* function APIs */
#define nvtxDomainSyncUserCreate         wnvtxDomainSyncUserCreate
#define nvtxDomainSyncUserDestroy        wnvtxDomainSyncUserDestroy
#define nvtxDomainSyncUserAcquireStart   wnvtxDomainSyncUserAcquireStart
#define nvtxDomainSyncUserAcquireFailed  wnvtxDomainSyncUserAcquireFailed
#define nvtxDomainSyncUserAcquireSuccess wnvtxDomainSyncUserAcquireSuccess
#define nvtxDomainSyncUserReleasing      wnvtxDomainSyncUserReleasing

/* ====================== mcToolsExtSync.h end ============================== */

/* ====================== mcToolsExtPayload.h ============================== */
#define NVTX_EXT_COMPATID_PAYLOAD                     MCTX_EXT_COMPATID_PAYLOAD
#define NVTX_EXT_MODULEID_PAYLOAD                     MCTX_EXT_MODULEID_PAYLOAD
#define NVTX_PAYLOAD_TYPE_BINARY                      MCTX_PAYLOAD_TYPE_BINARY
#define NVTX_PAYLOAD_ENTRY_FLAG_UNUSED                MCTX_PAYLOAD_ENTRY_FLAG_UNUSED
#define NVTX_PAYLOAD_ENTRY_FLAG_POINTER               MCTX_PAYLOAD_ENTRY_FLAG_POINTER
#define NVTX_PAYLOAD_ENTRY_FLAG_OFFSET_FROM_BASE      MCTX_PAYLOAD_ENTRY_FLAG_OFFSET_FROM_BASE
#define NVTX_PAYLOAD_ENTRY_FLAG_OFFSET_FROM_HERE      MCTX_PAYLOAD_ENTRY_FLAG_OFFSET_FROM_HERE
#define NVTX_PAYLOAD_ENTRY_FLAG_ARRAY_FIXED_SIZE      MCTX_PAYLOAD_ENTRY_FLAG_ARRAY_FIXED_SIZE
#define NVTX_PAYLOAD_ENTRY_FLAG_ARRAY_ZERO_TERMINATED MCTX_PAYLOAD_ENTRY_FLAG_ARRAY_ZERO_TERMINATED
#define NVTX_PAYLOAD_ENTRY_FLAG_ARRAY_LENGTH_INDEX    MCTX_PAYLOAD_ENTRY_FLAG_ARRAY_LENGTH_INDEX
#define NVTX_PAYLOAD_ENTRY_FLAG_DEEP_COPY             MCTX_PAYLOAD_ENTRY_FLAG_DEEP_COPY
#define NVTX_PAYLOAD_ENTRY_FLAG_EVENT_MESSAGE         MCTX_PAYLOAD_ENTRY_FLAG_EVENT_MESSAGE
#define NVTX_PAYLOAD_ENTRY_FLAG_IS_ARRAY              MCTX_PAYLOAD_ENTRY_FLAG_IS_ARRAY

#define NVTX_PAYLOAD_ENTRY_TYPE_INVALID    MCTX_PAYLOAD_ENTRY_TYPE_INVALID
#define NVTX_PAYLOAD_ENTRY_TYPE_CHAR       MCTX_PAYLOAD_ENTRY_TYPE_CHAR
#define NVTX_PAYLOAD_ENTRY_TYPE_UCHAR      MCTX_PAYLOAD_ENTRY_TYPE_UCHAR
#define NVTX_PAYLOAD_ENTRY_TYPE_SHORT      MCTX_PAYLOAD_ENTRY_TYPE_SHORT
#define NVTX_PAYLOAD_ENTRY_TYPE_USHORT     MCTX_PAYLOAD_ENTRY_TYPE_USHORT
#define NVTX_PAYLOAD_ENTRY_TYPE_INT        MCTX_PAYLOAD_ENTRY_TYPE_INT
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT       MCTX_PAYLOAD_ENTRY_TYPE_UINT
#define NVTX_PAYLOAD_ENTRY_TYPE_LONG       MCTX_PAYLOAD_ENTRY_TYPE_LONG
#define NVTX_PAYLOAD_ENTRY_TYPE_ULONG      MCTX_PAYLOAD_ENTRY_TYPE_ULONG
#define NVTX_PAYLOAD_ENTRY_TYPE_LONGLONG   MCTX_PAYLOAD_ENTRY_TYPE_LONGLONG
#define NVTX_PAYLOAD_ENTRY_TYPE_ULONGLONG  MCTX_PAYLOAD_ENTRY_TYPE_ULONGLONG
#define NVTX_PAYLOAD_ENTRY_TYPE_INT8       MCTX_PAYLOAD_ENTRY_TYPE_INT8
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT8      MCTX_PAYLOAD_ENTRY_TYPE_UINT8
#define NVTX_PAYLOAD_ENTRY_TYPE_INT16      MCTX_PAYLOAD_ENTRY_TYPE_INT16
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT16     MCTX_PAYLOAD_ENTRY_TYPE_UINT16
#define NVTX_PAYLOAD_ENTRY_TYPE_INT32      MCTX_PAYLOAD_ENTRY_TYPE_INT32
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT32     MCTX_PAYLOAD_ENTRY_TYPE_UINT32
#define NVTX_PAYLOAD_ENTRY_TYPE_INT64      MCTX_PAYLOAD_ENTRY_TYPE_INT64
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT64     MCTX_PAYLOAD_ENTRY_TYPE_UINT64
#define NVTX_PAYLOAD_ENTRY_TYPE_FLOAT      MCTX_PAYLOAD_ENTRY_TYPE_FLOAT
#define NVTX_PAYLOAD_ENTRY_TYPE_DOUBLE     MCTX_PAYLOAD_ENTRY_TYPE_DOUBLE
#define NVTX_PAYLOAD_ENTRY_TYPE_LONGDOUBLE MCTX_PAYLOAD_ENTRY_TYPE_LONGDOUBLE

#define NVTX_PAYLOAD_ENTRY_TYPE_SIZE            MCTX_PAYLOAD_ENTRY_TYPE_SIZE
#define NVTX_PAYLOAD_ENTRY_TYPE_ADDRESS         MCTX_PAYLOAD_ENTRY_TYPE_ADDRESS
#define NVTX_PAYLOAD_ENTRY_TYPE_WCHAR           MCTX_PAYLOAD_ENTRY_TYPE_WCHAR
#define NVTX_PAYLOAD_ENTRY_TYPE_CHAR8           MCTX_PAYLOAD_ENTRY_TYPE_CHAR8
#define NVTX_PAYLOAD_ENTRY_TYPE_CHAR16          MCTX_PAYLOAD_ENTRY_TYPE_CHAR16
#define NVTX_PAYLOAD_ENTRY_TYPE_CHAR32          MCTX_PAYLOAD_ENTRY_TYPE_CHAR32
#define NVTX_PAYLOAD_ENTRY_TYPE_INFO_ARRAY_SIZE MCTX_PAYLOAD_ENTRY_TYPE_INFO_ARRAY_SIZE

#define NVTX_PAYLOAD_ENTRY_TYPE_BYTE     MCTX_PAYLOAD_ENTRY_TYPE_BYTE
#define NVTX_PAYLOAD_ENTRY_TYPE_INT128   MCTX_PAYLOAD_ENTRY_TYPE_INT128
#define NVTX_PAYLOAD_ENTRY_TYPE_UINT128  MCTX_PAYLOAD_ENTRY_TYPE_UINT128
#define NVTX_PAYLOAD_ENTRY_TYPE_FLOAT16  MCTX_PAYLOAD_ENTRY_TYPE_FLOAT16
#define NVTX_PAYLOAD_ENTRY_TYPE_FLOAT32  MCTX_PAYLOAD_ENTRY_TYPE_FLOAT32
#define NVTX_PAYLOAD_ENTRY_TYPE_FLOAT64  MCTX_PAYLOAD_ENTRY_TYPE_FLOAT64
#define NVTX_PAYLOAD_ENTRY_TYPE_FLOAT128 MCTX_PAYLOAD_ENTRY_TYPE_FLOAT128
#define NVTX_PAYLOAD_ENTRY_TYPE_BF16     MCTX_PAYLOAD_ENTRY_TYPE_BF16
#define NVTX_PAYLOAD_ENTRY_TYPE_TF32     MCTX_PAYLOAD_ENTRY_TYPE_TF32

#define NVTX_PAYLOAD_ENTRY_TYPE_SNORM8  MCTX_PAYLOAD_ENTRY_TYPE_SNORM8
#define NVTX_PAYLOAD_ENTRY_TYPE_UNORM8  MCTX_PAYLOAD_ENTRY_TYPE_UNORM8
#define NVTX_PAYLOAD_ENTRY_TYPE_SNORM16 MCTX_PAYLOAD_ENTRY_TYPE_SNORM16
#define NVTX_PAYLOAD_ENTRY_TYPE_UNORM16 MCTX_PAYLOAD_ENTRY_TYPE_UNORM16
#define NVTX_PAYLOAD_ENTRY_TYPE_SNORM32 MCTX_PAYLOAD_ENTRY_TYPE_SNORM32
#define NVTX_PAYLOAD_ENTRY_TYPE_UNORM32 MCTX_PAYLOAD_ENTRY_TYPE_UNORM32
#define NVTX_PAYLOAD_ENTRY_TYPE_SNORM64 MCTX_PAYLOAD_ENTRY_TYPE_SNORM64
#define NVTX_PAYLOAD_ENTRY_TYPE_UNORM64 MCTX_PAYLOAD_ENTRY_TYPE_UNORM64

#define NVTX_PAYLOAD_ENTRY_TYPE_CSTRING       MCTX_PAYLOAD_ENTRY_TYPE_CSTRING
#define NVTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF8  MCTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF8
#define NVTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF16 MCTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF16
#define NVTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF32 MCTX_PAYLOAD_ENTRY_TYPE_CSTRING_UTF32

#define NVTX_PAYLOAD_ENTRY_TYPE_NVTX_REGISTERED_STRING_HANDLE                                      \
    MCTX_PAYLOAD_ENTRY_TYPE_MCTX_REGISTERED_STRING_HANDLE
#define NVTX_PAYLOAD_ENTRY_TYPE_NVTX_CATEGORY  MCTX_PAYLOAD_ENTRY_TYPE_MCTX_CATEGORY
#define NVTX_PAYLOAD_ENTRY_TYPE_NVTX_COLORTYPE MCTX_PAYLOAD_ENTRY_TYPE_MCTX_COLORTYPE
#define NVTX_PAYLOAD_ENTRY_TYPE_NVTX_COLOR     MCTX_PAYLOAD_ENTRY_TYPE_MCTX_COLOR

#define NVTX_PAYLOAD_ENTRY_TYPE_UNION_SELECTOR MCTX_PAYLOAD_ENTRY_TYPE_UNION_SELECTOR
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP64    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP64

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_TSC MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_TSC
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_TSC_NONVIRTUALIZED                                   \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_TSC_NONVIRTUALIZED
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_REALTIME                               \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_REALTIME
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_REALTIME_COARSE                        \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_REALTIME_COARSE
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC                              \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC_RAW                          \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC_RAW
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC_COARSE                       \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_MONOTONIC_COARSE
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_BOOTTIME                               \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_BOOTTIME
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_PROCESS_CPUTIME_ID                     \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_PROCESS_CPUTIME_ID
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_THREAD_CPUTIME_ID                      \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPU_CLOCK_GETTIME_THREAD_CPUTIME_ID

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_QPC     MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_QPC
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_GSTAFT  MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_GSTAFT
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_GSTAFTP MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_WIN_GSTAFTP

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_TIME  MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_TIME
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_CLOCK MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_TIMESPEC_GET                                           \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_C_TIMESPEC_GET

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_STEADY_CLOCK                                         \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_STEADY_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_HIGH_RESOLUTION_CLOCK                                \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_HIGH_RESOLUTION_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_SYSTEM_CLOCK                                         \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_SYSTEM_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_UTC_CLOCK                                            \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_UTC_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_TAI_CLOCK                                            \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_TAI_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_GPS_CLOCK                                            \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_GPS_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_FILE_CLOCK                                           \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_CPP_FILE_CLOCK

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_GLOBALTIMER                                          \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_GLOBALTIMER
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_SM_CLOCK                                             \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_SM_CLOCK
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_SM_CLOCK64                                           \
    MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_SM_CLOCK64
#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_CUPTI MCTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_GPU_CUPTI

#define NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_TOOL_PROVIDED                                            \
    NVTX_PAYLOAD_ENTRY_TYPE_TIMESTAMP_TOOL_PROVIDED

#define NVTX_TYPE_PAYLOAD_SCHEMA_REFERENCED MCTX_TYPE_PAYLOAD_SCHEMA_REFERENCED
#define NVTX_TYPE_PAYLOAD_SCHEMA_RAW        MCTX_TYPE_PAYLOAD_SCHEMA_RAW
#define NVTX_PAYLOAD_ENTRY_TYPE_SCHEMA_ID_STATIC_START                                             \
    MCTX_PAYLOAD_ENTRY_TYPE_SCHEMA_ID_STATIC_START
#define NVTX_PAYLOAD_ENTRY_TYPE_SCHEMA_ID_DYNAMIC_START                                            \
    MCTX_PAYLOAD_ENTRY_TYPE_SCHEMA_ID_DYNAMIC_START

#define NVTX_PAYLOAD_CONCAT2 MCTX_PAYLOAD_CONCAT2
#define NVTX_PAYLOAD_CONCAT  MCTX_PAYLOAD_CONCAT
#define NVTX_DATA_VAR        MCTX_DATA_VAR

#define NVTX_PAYLOAD_EVTATTR_SET          MCTX_PAYLOAD_EVTATTR_SET
#define NVTX_PAYLOAD_EVTATTR_SET_MULTIPLE MCTX_PAYLOAD_EVTATTR_SET_MULTIPLE

#define NVTX_PAYLOAD_SCHEMA_TYPE_INVALID MCTX_PAYLOAD_SCHEMA_TYPE_INVALID
#define NVTX_PAYLOAD_SCHEMA_TYPE_STATIC  MCTX_PAYLOAD_SCHEMA_TYPE_STATIC
#define NVTX_PAYLOAD_SCHEMA_TYPE_DYNAMIC MCTX_PAYLOAD_SCHEMA_TYPE_DYNAMIC
#define NVTX_PAYLOAD_SCHEMA_TYPE_UNION   MCTX_PAYLOAD_SCHEMA_TYPE_UNION
#define NVTX_PAYLOAD_SCHEMA_TYPE_UNION_WITH_INTERNAL_SELECTOR                                      \
    MCTX_PAYLOAD_SCHEMA_TYPE_UNION_WITH_INTERNAL_SELECTOR

#define NVTX_PAYLOAD_SCHEMA_FLAG_NONE           MCTX_PAYLOAD_SCHEMA_FLAG_NONE
#define NVTX_PAYLOAD_SCHEMA_FLAG_DEEP_COPY      MCTX_PAYLOAD_SCHEMA_FLAG_DEEP_COPY
#define NVTX_PAYLOAD_SCHEMA_FLAG_REFERENCED     MCTX_PAYLOAD_SCHEMA_FLAG_REFERENCED
#define NVTX_PAYLOAD_SCHEMA_FLAG_DEFERRED_EVENT MCTX_PAYLOAD_SCHEMA_FLAG_DEFERRED_EVENT
#define NVTX_PAYLOAD_SCHEMA_FLAG_DEFERRED_RANGE MCTX_PAYLOAD_SCHEMA_FLAG_DEFERRED_RANGE

#define NVTX_PAYLOAD_SCHEMA_ATTR_NAME        MCTX_PAYLOAD_SCHEMA_ATTR_NAME
#define NVTX_PAYLOAD_SCHEMA_ATTR_TYPE        MCTX_PAYLOAD_SCHEMA_ATTR_TYPE
#define NVTX_PAYLOAD_SCHEMA_ATTR_FLAGS       MCTX_PAYLOAD_SCHEMA_ATTR_FLAGS
#define NVTX_PAYLOAD_SCHEMA_ATTR_ENTRIES     MCTX_PAYLOAD_SCHEMA_ATTR_ENTRIES
#define NVTX_PAYLOAD_SCHEMA_ATTR_NUM_ENTRIES MCTX_PAYLOAD_SCHEMA_ATTR_NUM_ENTRIES
#define NVTX_PAYLOAD_SCHEMA_ATTR_STATIC_SIZE MCTX_PAYLOAD_SCHEMA_ATTR_STATIC_SIZE
#define NVTX_PAYLOAD_SCHEMA_ATTR_ALIGNMENT   MCTX_PAYLOAD_SCHEMA_ATTR_ALIGNMENT
#define NVTX_PAYLOAD_SCHEMA_ATTR_SCHEMA_ID   MCTX_PAYLOAD_SCHEMA_ATTR_SCHEMA_ID

#define nvtxPayloadEntryTypeInfo_t mctxPayloadEntryTypeInfo_t
#define nvtxPayloadSchemaEntry_t   mctxPayloadSchemaEntry_t
#define nvtxPayloadData_t          mctxPayloadData_t
#define nvtxPayloadSchemaType      mctxPayloadSchemaType
#define nvtxPayloadSchemaFlags     mctxPayloadSchemaFlags
#define nvtxPayloadSchemaAttr_t    mctxPayloadSchemaAttr_t
#define nvtxPayloadEnum_t          mctxPayloadEnum_t
#define nvtxPayloadEnumAttr_t      mctxPayloadEnumAttr_t
#define NvtxExtPayloadCallbackId   mctxExtPayloadCallbackId

#define NVTX_PAYLOAD_ENUM_ATTR_NAME        MCTX_PAYLOAD_ENUM_ATTR_NAME
#define NVTX_PAYLOAD_ENUM_ATTR_ENTRIES     MCTX_PAYLOAD_ENUM_ATTR_ENTRIES
#define NVTX_PAYLOAD_ENUM_ATTR_NUM_ENTRIES MCTX_PAYLOAD_ENUM_ATTR_NUM_ENTRIES
#define NVTX_PAYLOAD_ENUM_ATTR_SIZE        MCTX_PAYLOAD_ENUM_ATTR_SIZE
#define NVTX_PAYLOAD_ENUM_ATTR_SCHEMA_ID   MCTX_PAYLOAD_ENUM_ATTR_SCHEMA_ID

#define NVTX3EXT_CBID_nvtxPayloadSchemaRegister MCTXEXT_CBID_mctxPayloadSchemaRegister
#define NVTX3EXT_CBID_nvtxPayloadEnumRegister   MCTXEXT_CBID_mctxPayloadEnumRegister
#define NVTX3EXT_CBID_PAYLOAD_FN_NUM            MCTXEXT_CBID_PAYLOAD_FN_NUM

/* function APIs */
#define nvtxPayloadSchemaRegister   wnvtxPayloadSchemaRegister
#define nvtxPayloadEnumRegister     wnvtxPayloadEnumRegister

/* ====================== mcToolsExtPayload.h end ============================== */

#endif /* __NVTX_TO_MCTX_ADAPTOR_H__ */